<?php

namespace app\common\model;

/**
 * [ManagerDuty  法师权限表]
 * @author [C。]
 * @return html
 */
class ManagerDuty extends Base
{
    protected $name = 'manager_duty';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getlist($map,$from = 0, $size = 5)
    {
        $order = ['id' => 'desc'];

        $result =  $this->where($map)
            ->order($order)
            ->limit($from, $size)
            ->select();

        return $result;
    }

    /**
     * 根据条件来获取列表的数据的总数
     * @param array $param
     */
    public function getCountByCondition($map = []) {
        return $this->where($map)->count();
    }
    /**
     * 根据搜索条件获取总条数
     */
    public function insertdata($data)
    {
        $id = $this->insert($data);
        return $id;
    }
    /**
     * 根据搜索条件获取列表信息
     */
    public function limit($map, $from=0, $size = 5,$field='*')
    {
        $result =  $this->field($field)->where($map)
            ->limit($from, $size)
            ->select();

        return $result;
    }
}